package com.jnc.common.constant;

/**
 * @Author: jjn
 * @Date: 2018/10/31
 * @Desc: Shiro常量
 */
public class ShiroConstant {

    //当前用户的Key
    public static final String CURRENT_USER = "CURRENT_USER";

    //用户名
    public static final String USER_NAME = "username";

    //Shiro加密算法类型
    public static final String HASH_ENCRYPT_TYPE = "MD5";

    //循环加密次数
    public static final int HASH_ENCRYPT_NUM = 2;

    //全局session过期时间(毫秒)
    public static final int GLOBAL_SESSION_TIMEOUT = 600000;

    //自定义shiro session的cookie名称
    public static final String SESSIONID_COOKIE_NAME = "SHIRO_SESSION_ID";

    //自定义remeber me的cookie名称
    public static final String REMEBER_ME_COOKIE_NAME = "REMEBER_ME";

    //shiro session前缀
    public static final String SHIRO_SESSION_PREFIX = "shiro_session:";

    //shiro cache前缀
    public static final String SHIRO_CACHE_PREFIX = "shiro_cache:";

    //shiro session过期时间-秒
    public static final int EXPIRE_SECONDS = 600;

    //shiro 身份认证失败, 跳转登录界面
    public static final String LOGIN_URL = "/login";

    //shiro 权限认证失败，则跳转到指定页面
    public static final String UNAUTH_URL = "/unauth";
}
